<template>
 <div  class="breadItem">
<template v-if="to">
  <router-link to="to"> <slot></slot></router-link>
  <span>{{separator}}</span>
</template>
<template v-else>
<slot></slot>
<span>{{separator}}</span>
</template>
 </div>
</template>
<script>
export default{
    name:'MyBreadItem',
    inject:['separator'],
    data () {
        return {
            
        }
    },
    props:{
      to: [String, Object]
      //表示传递的数据类型是对象或者字符串
    },
    created () {
    },
    computed:{
    },
    methods:{
    }
}
</script>
<style lang='scss'  scoped>

    .breadItem{
        margin: 0 5px;
         &:last-child {
    span {
      display: none;
    }
  }
    }
    
</style>
